package dcutils.cards.mtg;

/**
 * Represents a single non-basic land card in Magic the Gathering.<br/>
 * @author dca
 */
public class LandCard extends Card {
	public LandCard(String landName, Rarity rarity, Expansion expansion) {
		super(landName, rarity, expansion, "Land");
	} // END constructor

	@Override
	public String toString() {
		StringBuffer buffer = new StringBuffer(1024);
		buffer.append(this.getClass().getSimpleName()); buffer.append(" [");

		buffer.append(String.format("%s = %s", "landName", getCardName()));
		buffer.append(", ");
		buffer.append(String.format("%s = %s", "rarity", getRarity()));
		buffer.append(", ");
		buffer.append(String.format("%s = %s", "expansion", getExpansion()));
		buffer.append(", ");
		buffer.append(String.format("%s = %s", "typeLine", getTypeLine()));
		buffer.append(", ");
		buffer.append(String.format("%s = %s", "cardText", getCardText()));
		buffer.append(", ");
		buffer.append(String.format("%s = %s", "flavorText", getFlavorText()));

		buffer.append("]");
		return buffer.toString();
	} // END toString

	@Override
	public boolean equals(Object obj) {
		if(null == obj) {
			return false;
		} else if(obj instanceof LandCard) {
			LandCard card = (LandCard)obj;
			return super.equals(card);
		} else {
			return false;
		} // END if/else
	} // END equals

	@Override
	public int hashCode() {
		int hashCode = 101;
		hashCode = (11 * hashCode) + super.hashCode();
		return hashCode;
	} // END hashCode

	@Override
	public String prettyPrint() {
		StringBuffer buffer = new StringBuffer(1024);
		buffer.append(this.getClass().getSimpleName()); buffer.append(String.format(" [%n"));

		buffer.append(String.format("\t%s = %s", "landName", getCardName()));
		buffer.append(String.format(",%n"));
		buffer.append(String.format("\t%s = %s", "rarity", getRarity()));
		buffer.append(String.format(",%n"));
		buffer.append(String.format("\t%s = %s", "expansion", getExpansion()));
		buffer.append(String.format(",%n"));
		buffer.append(String.format("\t%s = %s", "typeLine", getTypeLine()));
		buffer.append(String.format(",%n"));
		buffer.append(String.format("\t%s = %s", "cardText", getCardText()));
		buffer.append(String.format(",%n"));
		buffer.append(String.format("\t%s = %s", "flavorText", getFlavorText()));

		buffer.append(String.format("%n]"));
		return buffer.toString();
	} // END prettyPrint
} // END class LandCard
